package jhub.text;

import java.text.MessageFormat;
import java.text.ParseException;

import jhub.DCProtocol;

public class ConnectToMeMessage extends DCRawCommand {
    
    private String remoteNick;
    private String senderIp;
    private String senderPort;
    
    public ConnectToMeMessage(String command) throws ParseException {
        super(command);
        parse();
    }
    
    private void parse() throws ParseException{
        Object[] o = new MessageFormat(DCProtocol.CONNECTTOME_FORMAT).parse(command.toString());
        setRemoteNick(o[0].toString());
        setSenderIp(o[1].toString());
        setSenderPort(o[2].toString());
    }
    
    
    /**
     * @return Returns the remoteNick.
     */
    public String getRemoteNick() {
        return remoteNick;
    }

    public void setRemoteNick(String remoteNick) {
        this.remoteNick = remoteNick;
    }

    public String getSenderIp() {
        return senderIp;
    }

    public void setSenderIp(String senderIp) {
        this.senderIp = senderIp;
    }

    public String getSenderPort() {
        return senderPort;
    }

    public void setSenderPort(String senderPort) {
        this.senderPort = senderPort;
    }
    
}
